package com.itheima.health.vo;


import com.itheima.health.pojo.Menu;
import lombok.Data;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Data
public class MenuVO extends Menu {

    private Set<MenuVO> children = new HashSet<>();//子菜单集合

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        MenuVO menuVO = (MenuVO) o;

        return menuVO.getId()==this.getId();
    }

    @Override
    public int hashCode() {
        return this.getId();
    }
}
